<template>
  <div class="gg">
    <img :src="imgUrl" alt="" />
    <p @click="onClick(dogName)">{{ dogName }}</p>
  </div>
</template>

<script>
export default {
  props: ['imgUrl', 'dogName'],
  data () {
    return {}
  },

  created () {},

  methods: {
    onClick (name) {
      this.$emit('dogname', name)
    }
  }
}
</script>

<style scoped lang="less">
.gg {
  width: 200px;
  border: 1px solid black;
  text-align: center;
  float: left;
}
img {
  width: 100%;
  height: 200px;
}

p {
  display: inline-block;
  width: 100%;
}
</style>
